import xjaxios from "@/api/axios";
// let organizationNo = sessionStorage.getItem('organizationNo');
export default {
  gettreedata() {
    return xjaxios.post("route/queryAllRouteTreeList", { organizationNo: sessionStorage.organizationNo });
  },
  /**
     * @description: 获取角色所拥有的功能权限
     * @param {String} userId
     * @param {String} system
     * @return {Object}
     */
  // getfuncauth(par) {
  //   return xjaxios.get("/route/queryAllFunctionPermissionByUser", {
  //     params: {
  //       // system: "OM",
  //       organizationNo: sessionStorage.organizationNo,
  //       userId: par.id
  //     }
  //   });
  // },
  getfuncauth(par) {
    return xjaxios.post("/roleRouteMapper/queryByCondition", {
      // params: {
      //   // system: "OM",
      organizationNo: sessionStorage.organizationNo,
      roleId: par.id
      // }
    });
  },
  /**
     * @description: 分配功能权限
     * @param {String} userId
     * @param {String} system
     * @return {Object}
     */
  // addfuncauth(par) {
  //   return xjaxios.post("/permission/disFuncToUser", {
  //     // system: "OM",
  //     organizationNo: sessionStorage.organizationNo,
  //     userId: par.id,
  //     functionPermissionIdList: par.permisslist
  //   });
  // },
  addfuncauth(par) {
    return xjaxios.post("/roleRouteMapper/add", {
      // system: "OM",
      organizationNo: sessionStorage.organizationNo,
      roleId: par.id,
      routeIdList: par.permisslist,
      roleRouteMapperId: par.roleRouteMapperId || ''
    });
  }
}
